<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>PVRTMisc.h File Reference</h1><code>#include "<a class="el" href="PVRTMatrix_8h-source.html">PVRTMatrix.h</a>"</code><br>
<code>#include "<a class="el" href="PVRTFixedPoint_8h-source.html">PVRTFixedPoint.h</a>"</code><br>

<p>
Include dependency graph for PVRTMisc.h:<p><center><img src="PVRTMisc_8h__incl.png" border="0" usemap="#PVRTMisc.h_map" alt="Include dependency graph"></center>
<map name="PVRTMisc.h_map">
<area href="PVRTMatrix_8h.html" shape="rect" coords="164,156,271,183" alt="">
<area href="PVRTGlobal_8h.html" shape="rect" coords="163,81,269,108" alt="">
<area href="PVRTFixedPoint_8h.html" shape="rect" coords="7,156,140,183" alt="">
<area href="PVRTMathTable_8h.html" shape="rect" coords="8,81,139,108" alt="">
</map>

<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="PVRTMisc_8h__dep__incl.png" border="0" usemap="#PVRTMisc.hdep_map" alt="Included by dependency graph"></center>
<map name="PVRTMisc.hdep_map">
<area href="OGLES2Tools_8h.html" shape="rect" coords="7,7,124,34" alt="">
</map>

<p>
<a href="PVRTMisc_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="PVRTMisc_8h.html#a0">PVRTMiscCalculateIntersectionLinePlane</a> (<a class="el" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> *const pvIntersection, const VERTTYPE pfPlane[4], const <a class="el" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> *const pv0, const <a class="el" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> *const pv1)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="PVRTMisc_8h.html#a1">PVRTMiscCalculateInfinitePlane</a> (VERTTYPE *const pfVtx, const int nStride, const <a class="el" href="structPVRTVECTOR4f.html">PVRTVECTOR4</a> *const pvPlane, const <a class="el" href="classPVRTMATRIXf.html">PVRTMATRIX</a> *const pmViewProjInv, const <a class="el" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> *const pFrom, const VERTTYPE fFar)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="PVRTMisc_8h.html#a2">PVRTCreateSkybox</a> (float scale, bool adjustUV, int textureSize, VERTTYPE **Vertices, VERTTYPE **UVs)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="PVRTMisc_8h.html#a3">PVRTDestroySkybox</a> (VERTTYPE *Vertices, VERTTYPE *UVs)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="PVRTMisc_8h.html#a4">GetPOTHigher</a> (unsigned int uiOriginalValue, int iTimesHigher)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="PVRTMisc_8h.html#a5">GetPOTLower</a> (unsigned int uiOriginalValue, int iTimesLower)</td></tr>

</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a4" doxytag="PVRTMisc.h::GetPOTHigher" ></a><p>
<br><br><h3>GetPOTHigher</h3><br><div>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> unsigned int GetPOTHigher </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned int&nbsp;</td>
          <td class="mdname" nowrap> <em>uiOriginalValue</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>iTimesHigher</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Inputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>uiOriginalValue</em>&nbsp;</td><td>Base value </td></tr>
    <tr><td valign=top><em>iTimesHigher</em>&nbsp;</td><td>Multiplier </td></tr>
  </table>
</dl>
<dl compact><dt><b>Description:</b></dt><dd>When iTimesHigher is one, this function will return the closest power-of-two value above the base value. For every increment beyond one for the iTimesHigher value, the next highest power-of-two value will be calculated. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a5" doxytag="PVRTMisc.h::GetPOTLower" ></a><p>
<br><br><h3>GetPOTLower</h3><br><div>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> unsigned int GetPOTLower </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned int&nbsp;</td>
          <td class="mdname" nowrap> <em>uiOriginalValue</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>iTimesLower</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Inputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>uiOriginalValue</em>&nbsp;</td><td>Base value </td></tr>
    <tr><td valign=top><em>iTimesLower</em>&nbsp;</td><td>Multiplier </td></tr>
  </table>
</dl>
<dl compact><dt><b>Description:</b></dt><dd>When iTimesLower is one, this function will return the closest power-of-two value below the base value. For every increment beyond one for the iTimesLower value, the next lowest power-of-two value will be calculated. The lowest value that can be reached is 1. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a2" doxytag="PVRTMisc.h::PVRTCreateSkybox" ></a><p>
<br><br><h3>PVRTCreateSkybox</h3><br><div>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void PVRTCreateSkybox </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">float&nbsp;</td>
          <td class="mdname" nowrap> <em>scale</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>bool&nbsp;</td>
          <td class="mdname" nowrap> <em>adjustUV</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>textureSize</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>VERTTYPE **&nbsp;</td>
          <td class="mdname" nowrap> <em>Vertices</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>VERTTYPE **&nbsp;</td>
          <td class="mdname" nowrap> <em>UVs</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Inputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>scale</em>&nbsp;</td><td>Scale the skybox </td></tr>
    <tr><td valign=top><em>adjustUV</em>&nbsp;</td><td>Adjust or not UVs for PVRT compression </td></tr>
    <tr><td valign=top><em>textureSize</em>&nbsp;</td><td>Texture size in pixels </td></tr>
  </table>
</dl>
<dl compact><dt><b>Outputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>Vertices</em>&nbsp;</td><td>Array of vertices </td></tr>
    <tr><td valign=top><em>UVs</em>&nbsp;</td><td>Array of UVs </td></tr>
  </table>
</dl>
<dl compact><dt><b>Description:</b></dt><dd>Creates the vertices and texture coordinates for a skybox </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a3" doxytag="PVRTMisc.h::PVRTDestroySkybox" ></a><p>
<br><br><h3>PVRTDestroySkybox</h3><br><div>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void PVRTDestroySkybox </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">VERTTYPE *&nbsp;</td>
          <td class="mdname" nowrap> <em>Vertices</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>VERTTYPE *&nbsp;</td>
          <td class="mdname" nowrap> <em>UVs</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Inputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>Vertices</em>&nbsp;</td><td>Vertices array to destroy </td></tr>
    <tr><td valign=top><em>UVs</em>&nbsp;</td><td>UVs array to destroy </td></tr>
  </table>
</dl>
<dl compact><dt><b>Description:</b></dt><dd>Destroy the memory allocated for a skybox </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a1" doxytag="PVRTMisc.h::PVRTMiscCalculateInfinitePlane" ></a><p>
<br><br><h3>PVRTMiscCalculateInfinitePlane</h3><br><div>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int PVRTMiscCalculateInfinitePlane </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">VERTTYPE *const&nbsp;</td>
          <td class="mdname" nowrap> <em>pfVtx</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const int&nbsp;</td>
          <td class="mdname" nowrap> <em>nStride</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="structPVRTVECTOR4f.html">PVRTVECTOR4</a> *const&nbsp;</td>
          <td class="mdname" nowrap> <em>pvPlane</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="classPVRTMATRIXf.html">PVRTMATRIX</a> *const&nbsp;</td>
          <td class="mdname" nowrap> <em>pmViewProjInv</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> *const&nbsp;</td>
          <td class="mdname" nowrap> <em>pFrom</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const VERTTYPE&nbsp;</td>
          <td class="mdname" nowrap> <em>fFar</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Inputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>nStride</em>&nbsp;</td><td>Size of each vertex structure containing pfVtx </td></tr>
    <tr><td valign=top><em>pvPlane</em>&nbsp;</td><td>Length 4 [A,B,C,D], values for plane equation </td></tr>
    <tr><td valign=top><em>pmViewProjInv</em>&nbsp;</td><td>The inverse of the View Projection matrix </td></tr>
    <tr><td valign=top><em>pFrom</em>&nbsp;</td><td>Position of the camera </td></tr>
    <tr><td valign=top><em>fFar</em>&nbsp;</td><td>Far clipping distance </td></tr>
  </table>
</dl>
<dl compact><dt><b>Outputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>pfVtx</em>&nbsp;</td><td>Position of the first of 3 floats to receive the position of vertex 0; up to 5 vertex positions will be written (5 is the maximum number of vertices required to draw an infinite polygon clipped to screen and far clip plane). </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Number of vertices in the polygon fan (Can be 0, 3, 4 or 5) </dd></dl>
<dl compact><dt><b>Description:</b></dt><dd>Calculates world-space coords of a screen-filling representation of an infinite plane The resulting vertices run counter-clockwise around the screen, and can be simply drawn using non-indexed TRIANGLEFAN </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a0" doxytag="PVRTMisc.h::PVRTMiscCalculateIntersectionLinePlane" ></a><p>
<br><br><h3>PVRTMiscCalculateIntersectionLinePlane</h3><br><div>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void PVRTMiscCalculateIntersectionLinePlane </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> *const&nbsp;</td>
          <td class="mdname" nowrap> <em>pvIntersection</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const VERTTYPE&nbsp;</td>
          <td class="mdname" nowrap> <em>pfPlane</em>[4], </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> *const&nbsp;</td>
          <td class="mdname" nowrap> <em>pv0</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> *const&nbsp;</td>
          <td class="mdname" nowrap> <em>pv1</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Inputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>pfPlane</em>&nbsp;</td><td>Length 4 [A,B,C,D], values for plane equation </td></tr>
    <tr><td valign=top><em>pv0</em>&nbsp;</td><td>A point on the line </td></tr>
    <tr><td valign=top><em>pv1</em>&nbsp;</td><td>Another point on the line </td></tr>
  </table>
</dl>
<dl compact><dt><b>Outputs:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>pvIntersection</em>&nbsp;</td><td>The point of intersection </td></tr>
  </table>
</dl>
<dl compact><dt><b>Description:</b></dt><dd>Calculates coords of the intersection of a line and an infinite plane </dd></dl>
    </td>
  </tr>
</table>
<br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
